<template>
	<div class="shopsetting">
		<ul class="shop-text">
			<li class="shop-text-list">
				<p>特色馆名称</p>
				<input type="text" name="" id="" value="" placeholder="请填写店铺名称" v-model="shopname"/>
			</li>
			<li class="shop-text-list">
				<p>联系方式</p>
				<input type="text" placeholder="请输入手机号码" v-model="shoptel"/>
			</li>
		</ul>
		<ul class="shop-btn">
			<li class="shop-btn-list"><p>短信提示</p></li>
			<li class="shop-btn-list" @click="mjtz1=!mjtz1">
				<i v-show="!mjtz1"><img src="../../img-address/icon_dis@3x.png"/></i>
				<i v-show="mjtz1"><img src="../../img-address/icon_select@2x.png"/></i>
				<span>买家下单待付款通知</span>
			</li>
			<li class="shop-btn-list" @click="mjfh2=!mjfh2">
				<i v-show="!mjfh2"><img src="../../img-address/icon_dis@3x.png"/></i>
				<i v-show="mjfh2"><img src="../../img-address/icon_select@2x.png"/></i>
				<span>卖家发货通知买家</span>
			</li>
			<li class="shop-btn-list" @click="mjfk3=!mjfk3">
				<i v-show="!mjfk3"><img src="../../img-address/icon_dis@3x.png"/></i>
				<i v-show="mjfk3"><img src="../../img-address/icon_select@2x.png"/></i>
				<span>买家付款通知</span>
			</li>
		</ul>
		<div class="shopsettingsend" @click="sendbao">保存</div>
	</div>
</template>

<script>
	export default{
		data () {
			return{
				user:0,
				shopname:'',
				shoptel:'',
				mjtz1:true,
				mjfh2:true,
				mjfk3:true
			}
		},
		created:function(){
			this.user=localStorage.getItem("nt_user");
		},
		methods:{
			sendbao:function(){
				var self=this;
				var funs=[];
				if(this.mjtz1){
					funs.push({'name':'buy'});
				}
				if(this.mjfh2){
					funs.push({'name':'send'});
				}
				if(this.mjfk3){
					funs.push({'name':'check'});
				}
				console.log(funs);
				$.ajax({
					type:"post",
					url:furl+"index.php?app=ajax_seller_member&act=store_index",
					data:{'token':self.user,'functions':funs,'mobile':self.shoptel,'store_name':self.shopname},
					dataType:'json',
					success:function(res){
						if(res.done){
							history.go(-1);
						}
					}
				});
			}
		},
		mounted:function(){
			var self=this;
			$.ajax({
				type:"get",
				url:furl+"index.php?app=ajax_seller_member&act=store_index",
				data:{'token':self.user},
				dataType:'json',
				success:function(res){
					if(res.done){
						self.shopname=res.retval.store_name;
						self.shoptel=res.retval.mobile;
						self.mjtz1=res.retval.functions[0].status;
						self.mjfh2=res.retval.functions[1].status;
						self.mjfk3=res.retval.functions[2].status;
					}
				}
			});
		}
	}
</script>

<style>
	.shopsetting{font-size:0;}
	.shop-text{background-color:#fff;padding-left: 0.32rem;padding-right: 0.32rem;}
	.shop-text-list{padding-top: 0.16rem;padding-bottom: 0.16rem;border-bottom: 1px solid #D6D6D6;}
	.shop-text-list>p{font-size:0.28rem;color:#FF9C03;line-height: 0.6rem;}
	.shop-text-list>input{font-size:0.32rem;color:#2B2B2B;line-height: 0.64rem;height:0.64rem;width:100%;}
	.shop-btn{background-color:#fff;padding-left: 0.32rem;padding-right: 0.32rem;padding-top: 0.06rem;padding-bottom:0.06rem;}
	.shop-btn-list{padding-top: 0.08rem;padding-bottom: 0.08rem;}
	.shop-btn-list>p{font-size:0.28rem;color:#FF9C03;line-height: 0.6rem;}
	.shop-btn-list>i{display: inline-block;width:0.34rem;height:0.34rem;float:left;margin-right: 0.2rem;}
	.shop-btn-list>i>img{width:100%;height:100%;}
	.shop-btn-list>span{font-size:0.32rem;color:#999;}
	.shopsettingsend{width:6.86rem;height:1rem;border-radius:0.5rem;line-height: 1rem;text-align: center;background: -webkit-linear-gradient(left, #ffbb03 , #ff9c03); background: -o-linear-gradient(right, #ffbb03, #ff9c03); background: -moz-linear-gradient(right, #ffbb03, #ff9c03);background: linear-gradient(to right, #ffbb03 , #ff9c03);color:#fff;font-size:0.36rem;margin: 0.6rem auto;box-sizing: border-box;letter-spacing: 0.2rem;padding-left: 0.2rem;}
</style>